package com.tina.controller;

import com.alibaba.fastjson.JSON;
import com.tina.entity.vo.TiSlideshowVo;
import com.tina.model.ResultFormat;
import com.tina.util.ResultUtil;
import com.tina.util.http.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Tina
 * @version 0.0.1
 * @date 2020/6/23 9:22
 * <p>
 * 第三方api接口
 **/
@RestController
public class TiApiController {

    private Logger logger = LoggerFactory.getLogger(TiApiController.class);

    /**
     * 调用新浪API新冠疫情数据
     *
     * @return
     */
    @CrossOrigin
    @GetMapping("queryEpidemicData")
    public String queryEpidemicData() {
        String s = HttpUtils.sendGet("https://interface.sina.cn/news/wap/fymap2020_data.d.json", null);
        //logger.info("interface.sina.cn={}",JSON.toJSON(s));
        System.out.println(JSON.toJSON(s));
        return s;
    }
}
